package com.galaxy.device.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.device.domain.DeviceChannel;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

/**
 * 设备通道业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = DeviceChannel.class, reverseConvertGenerate = false)
public class DeviceChannelBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 设备ID
     */
    @NotNull(message = "设备ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long deviceId;

    /**
     * 通道编号
     */
    @NotBlank(message = "通道编号不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 0, max = 20, message = "通道编号长度不能超过20个字符")
    private String channelNo;

    /**
     * 通道位置(如A1, B2等)
     */
    @NotBlank(message = "通道位置不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 0, max = 50, message = "通道位置长度不能超过50个字符")
    private String channelPosition;

    /**
     * 通道类型(1:弹簧式,2:传送带式)
     */
    @NotNull(message = "通道类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer channelType;

    /**
     * 最大容量
     */
    @NotNull(message = "最大容量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer maxCapacity;

    /**
     * 状态(0:禁用,1:正常,2:故障)
     */
    private Integer status;
}
